var http = require('http');
var url = require('url');
var querystring = require('querystring');

var server = http.createServer( function (req , res) {
	
	var page = url.parse(req.url).pathname;
	var params = querystring.parse(url.parse(req.url).query);
	
	if (page == '/') {
		
		res.writeHead(200 , {"Content-Type":"text/html"});
		
		res.write(
		' <! DOCTYPE html >'+
		'<html>'+
		'<head>'+
	  '<meta charset ="utf-8"/>'+
		'<title>Ma premiere app nodejs</title>'+
	  '</head>'+
	  '<body>'+
	  '<p><strong>Ma première app nodejs !!</strong></p>'+
	  '</body>'+
	  '</html>'
	  );

		res.end();
		
	}

});

server.listen(8080);